//
//  TabviewViewModel.h
//  txlc_ios
//
//  Created by ayi on 2018/10/7.
//  Copyright © 2018 txlc. All rights reserved.
//

#import "BaseViewModel.h"

NS_ASSUME_NONNULL_BEGIN

@protocol TabviewViewModelDelegate <NSObject>

@required

@optional                                  //------------------------------ tableview
- (NSInteger)vm_numberOfSectionsInTableView:(UITableView *)tableView;
- (NSInteger)vm_tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
- (UITableViewCell *)vm_tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

- (CGFloat)vm_tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
- (UIView *)vm_tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
- (UIView *)vm_tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;
- (CGFloat)vm_tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
- (CGFloat)vm_tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;


//仅支持一维，二维数组  该代理可用   默认一维
- (void)vm_tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath andModel:(id)model;


@optional                                   //------------------------------ collectionview




@optional                                   //------------------------------ scrollviewdelegate
- (void)vm_scrollViewDidScroll:(UIScrollView *)scrollView;

@end






@interface TabviewViewModel : BaseViewModel<UITableViewDataSource,UITableViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>

@property (nonatomic, weak) UITableView *childtab;//子列表
@property (nonatomic, weak) UIScrollView *childScroll;//空页面
@property (nonatomic, weak) UICollectionView *childcollview;//子列表
@property (nonatomic, weak) UICollectionViewFlowLayout *flowLayout;//
@property (nonatomic, weak) BaseViewController *childvc;//子控件
@property (nonatomic, weak) id<TabviewViewModelDelegate> delegate;
@property (nonatomic, strong) BaseNetResponseModel *responseModel;

@property (nonatomic) CGFloat rowHeight;//cell高度
@property (nonatomic) CGFloat sectionHeaderHeight;//cellheader 高度
@property (nonatomic) CGFloat sectionFooterHeight;//cellfooter 高度
@property (nonatomic, strong) UIColor *sectionHeaderColor;
@property (nonatomic, strong) UIColor *sectionFooterColor;

@property (nonatomic, strong) NSMutableArray *listAry;//列表。 仅支持一维，二维数组

@end

NS_ASSUME_NONNULL_END
